package cn.ljy.uem.web.action.backstage.school;

import cn.ljy.authority.web.controller.backstage.BaseBackstageController;
import cn.ljy.common.model.result.ResponseData;
import cn.ljy.uem.model.SchoolConfig;
import cn.ljy.uem.model.query.SchoolConfigQuery;
import cn.ljy.uem.service.SchoolConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;

/**
 * 教师课程权限设置控制器
 *
 * @author 王秋林
 * @date 2022/10/25
 */
@Api(tags = "后台的教师课程权限设置模块")
@RestController
@RequestMapping(value = "/api/backstage/school/schoolconfig")
public class SchoolConfigController extends BaseBackstageController<SchoolConfig, SchoolConfigQuery, Integer> {

    @Autowired
    private SchoolConfigService baseService;

    @ApiOperation(value = "查询所有教师课程权限设置")
    @GetMapping("/all")
    @Override
    protected ResponseData query(SchoolConfigQuery query) {
        return super.query(query);
    }


    @ApiOperation(value = "读取教师课程权限设置信息")
    @Override
    protected ResponseData get(@PathVariable("id") Integer id) {
        return super.get(id);
    }

    @ApiOperation(value = "删除教师课程权限设置")
    @Override
    protected ResponseData deletes(@NotEmpty(message = "操作失败：请选择要移除的记录") Integer[] ids) {
        return super.deletes(ids);
    }

    @ApiOperation(value = "添加教师课程权限设置")
    @Override
    protected ResponseData add(@Valid @RequestBody SchoolConfig schoolConfig) {
        return super.add(schoolConfig);
    }

    @ApiOperation(value = "编辑教师课程权限设置")
    @Override
    protected ResponseData edit(@Valid @RequestBody SchoolConfig schoolConfig) {
        return super.edit(schoolConfig);
    }


}
